using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_UnitGroupMap : EntityTypeConfiguration<t_UnitGroup>
    {
        public t_UnitGroupMap()
        {
            // Primary Key
            this.HasKey(t => t.FUnitGroupID);

            // Properties
            this.Property(t => t.FUnitGroupID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FName)
                .IsRequired()
                .HasMaxLength(80);

            this.Property(t => t.FModifyTime)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(8)
                .IsRowVersion();

            // Table & Column Mappings
            this.ToTable("t_UnitGroup");
            this.Property(t => t.FUnitGroupID).HasColumnName("FUnitGroupID");
            this.Property(t => t.FName).HasColumnName("FName");
            this.Property(t => t.FDefaultUnitID).HasColumnName("FDefaultUnitID");
            this.Property(t => t.FModifyTime).HasColumnName("FModifyTime");
            this.Property(t => t.UUID).HasColumnName("UUID");
        }
    }
}
